<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<style>
    fieldset{border:1px solid #1ab394; padding:10px;}
    legend{display: block;
        width: auto;
        padding: 0;
        margin-bottom: 0;
        font-size: 14px;
        color: #333;
        border: none;
    }

    .input-upload{ position: relative;}
    .input-upload input[type="file"]{ position: absolute; left: 0px; top: 0px; width: 72px; height: 35px; opacity:.0;filter:alpha(opacity=00);}





</style>

<form class="form-horizontal" id="addForm" method="post">
    <fieldset>
        <input hidden id="articleId" th:value="${article.id}">
        <legend>文章信息</legend>
        <div class="form-group">
            <label class="col-sm-2 control-label">文章标题</label>
            <div class="col-sm-10">
                <input class="form-control" id="title" maxlength="35" name="title" th:value="${article.title}"
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">文章分类</label>
            <div class="col-sm-10">
                <select class="chosen-select" data-placeholder="请选择标签" id="categoryId" name="categoryId"
                        style="width:430px;">
                    <option th:each="category : ${categoryList}"
                            th:selected="${category.id}==${article.columnId}?'selected':'false'"
                            th:text="${category.categoryName}"
                            th:value="${category.id}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">文章标签</label>
            <div class="col-sm-10">
                <select class="chosen-select" data-placeholder="请选择标签" id="tagId" multiple name="tagId"
                        style="width:430px;" tabindex="5">
                    <option hassubinfo="true" th:each="tag : ${tagList}" th:text="${tag.tagName}"
                            th:value="${tag.id}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">文章描述</label>
            <div class="col-sm-10">
                <textarea class="form-control" id="description" maxlength="200" name="description" rows="4"
                          style="width: 430px"
                          th:text="${article.desc}" type="text"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-4">
                <button class="btn btn-primary" onclick="save()" type="button">保存</button>
                <button class="btn btn-white" onclick="cancelSaveArticle()" type="button">取消</button>
            </div>
        </div>
    </fieldset>
</form>
</html>